package com.jianbing.util;

/**
 * Created by Han, Tixiang on 2016/8/24 0024.
 */
public class CharUtils {
    // 是英文或数字
    public static Boolean IsEnglishOrNum(char c) {
        return (IsEnglish(c) || IsNum(c));
    }


    //是中文
    public static Boolean IsChinese(char c) {
        //     \\u4E00-\\u9FBF
        return (c >= 19968 && c <= 40895);
    }

    // 是英文小写字母和下划线，减号
    public static Boolean IsEnglish(char c) {
        return ((c >= 97 && c <= 122) || c == 45 || c == 95);
    }

    public static boolean is_(char c) {
        return c == 45;
    }

    public static boolean isMinus(char c) {
        return c == 95;
    }

    public static boolean isLetter(char c) {
        return (c >= 97 && c <= 122);
    }

    // 数字
    public static Boolean IsNum(char c) {
        return (c >= 48 && c <= 57);
    }
}
